/*
 * XML Type:  EmailResponseMessageSetV1
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.EmailResponseMessageSetV1
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML EmailResponseMessageSetV1(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class EmailResponseMessageSetV1Impl extends net.ofx.types.x2003.x04.impl.AbstractResponseMessageSetImpl implements net.ofx.types.x2003.x04.EmailResponseMessageSetV1
{
    
    public EmailResponseMessageSetV1Impl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MAILTRNRS$0 = 
        new javax.xml.namespace.QName("", "MAILTRNRS");
    private static final javax.xml.namespace.QName MAILSYNCRS$2 = 
        new javax.xml.namespace.QName("", "MAILSYNCRS");
    private static final javax.xml.namespace.QName GETMIMETRNRS$4 = 
        new javax.xml.namespace.QName("", "GETMIMETRNRS");
    
    
    /**
     * Gets array of all "MAILTRNRS" elements
     */
    public net.ofx.types.x2003.x04.MailTransactionResponse[] getMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAILTRNRS$0, targetList);
            net.ofx.types.x2003.x04.MailTransactionResponse[] result = new net.ofx.types.x2003.x04.MailTransactionResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "MAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.MailTransactionResponse getMAILTRNRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionResponse)get_store().find_element_user(MAILTRNRS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "MAILTRNRS" element
     */
    public int sizeOfMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAILTRNRS$0);
        }
    }
    
    /**
     * Sets array of all "MAILTRNRS" element
     */
    public void setMAILTRNRSArray(net.ofx.types.x2003.x04.MailTransactionResponse[] mailtrnrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(mailtrnrsArray, MAILTRNRS$0);
        }
    }
    
    /**
     * Sets ith "MAILTRNRS" element
     */
    public void setMAILTRNRSArray(int i, net.ofx.types.x2003.x04.MailTransactionResponse mailtrnrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionResponse)get_store().find_element_user(MAILTRNRS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(mailtrnrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "MAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.MailTransactionResponse insertNewMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionResponse)get_store().insert_element_user(MAILTRNRS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "MAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.MailTransactionResponse addNewMAILTRNRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionResponse)get_store().add_element_user(MAILTRNRS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "MAILTRNRS" element
     */
    public void removeMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAILTRNRS$0, i);
        }
    }
    
    /**
     * Gets array of all "MAILSYNCRS" elements
     */
    public net.ofx.types.x2003.x04.MailSyncResponse[] getMAILSYNCRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAILSYNCRS$2, targetList);
            net.ofx.types.x2003.x04.MailSyncResponse[] result = new net.ofx.types.x2003.x04.MailSyncResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "MAILSYNCRS" element
     */
    public net.ofx.types.x2003.x04.MailSyncResponse getMAILSYNCRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncResponse target = null;
            target = (net.ofx.types.x2003.x04.MailSyncResponse)get_store().find_element_user(MAILSYNCRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "MAILSYNCRS" element
     */
    public int sizeOfMAILSYNCRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAILSYNCRS$2);
        }
    }
    
    /**
     * Sets array of all "MAILSYNCRS" element
     */
    public void setMAILSYNCRSArray(net.ofx.types.x2003.x04.MailSyncResponse[] mailsyncrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(mailsyncrsArray, MAILSYNCRS$2);
        }
    }
    
    /**
     * Sets ith "MAILSYNCRS" element
     */
    public void setMAILSYNCRSArray(int i, net.ofx.types.x2003.x04.MailSyncResponse mailsyncrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncResponse target = null;
            target = (net.ofx.types.x2003.x04.MailSyncResponse)get_store().find_element_user(MAILSYNCRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(mailsyncrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "MAILSYNCRS" element
     */
    public net.ofx.types.x2003.x04.MailSyncResponse insertNewMAILSYNCRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncResponse target = null;
            target = (net.ofx.types.x2003.x04.MailSyncResponse)get_store().insert_element_user(MAILSYNCRS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "MAILSYNCRS" element
     */
    public net.ofx.types.x2003.x04.MailSyncResponse addNewMAILSYNCRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncResponse target = null;
            target = (net.ofx.types.x2003.x04.MailSyncResponse)get_store().add_element_user(MAILSYNCRS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "MAILSYNCRS" element
     */
    public void removeMAILSYNCRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAILSYNCRS$2, i);
        }
    }
    
    /**
     * Gets array of all "GETMIMETRNRS" elements
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionResponse[] getGETMIMETRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(GETMIMETRNRS$4, targetList);
            net.ofx.types.x2003.x04.GetMimeTransactionResponse[] result = new net.ofx.types.x2003.x04.GetMimeTransactionResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "GETMIMETRNRS" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionResponse getGETMIMETRNRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionResponse)get_store().find_element_user(GETMIMETRNRS$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "GETMIMETRNRS" element
     */
    public int sizeOfGETMIMETRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(GETMIMETRNRS$4);
        }
    }
    
    /**
     * Sets array of all "GETMIMETRNRS" element
     */
    public void setGETMIMETRNRSArray(net.ofx.types.x2003.x04.GetMimeTransactionResponse[] getmimetrnrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(getmimetrnrsArray, GETMIMETRNRS$4);
        }
    }
    
    /**
     * Sets ith "GETMIMETRNRS" element
     */
    public void setGETMIMETRNRSArray(int i, net.ofx.types.x2003.x04.GetMimeTransactionResponse getmimetrnrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionResponse)get_store().find_element_user(GETMIMETRNRS$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(getmimetrnrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "GETMIMETRNRS" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionResponse insertNewGETMIMETRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionResponse)get_store().insert_element_user(GETMIMETRNRS$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "GETMIMETRNRS" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionResponse addNewGETMIMETRNRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionResponse)get_store().add_element_user(GETMIMETRNRS$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "GETMIMETRNRS" element
     */
    public void removeGETMIMETRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(GETMIMETRNRS$4, i);
        }
    }
}
